#ifndef BROADCAST_H
#define BROADCAST_H

#include <iostream>
#include <cstring>
#include <thread>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include "MessageQueue.h"


class Broadcast {
public:
    Broadcast(int port);

    ~Broadcast();

    void send(const std::string& message, const std::string& address) ;

private:
    void receive();

    int sockfd_;
    int port_;
    bool running_;
    std::thread recv_thread_;
private:
    MessageQueue *Msg = nullptr;

};

#endif